// /**
//  * Copyright © 2015 Magento. All rights reserved.
//  * See COPYING.txt for license details.
//  */

@account-title-border-color: @color-gray-middle2;
@account-table-border-bottom-color: @color-gray-middle1;
@account-table-action-delete: @color-red12;

//
//  Common
//  ---------------------------------------------

& when (@media-common = true) {

.login-container {
    .block {
        &-new-customer {
            .actions-toolbar {
                margin-top: 25px;
            }
        }
        .block-title {
            &:extend(.abs-login-block-title all);
            .lib-font-size(18);
        }
    }
    .fieldset {
        .lib-form-hasrequired(bottom);
        &:after {
            margin-top: 25px;
        }
    }
}

.login-container, .form.password.reset, .form.send.confirmation, .form.password.forget, .form.create.account, .form.form-edit-account, .form-address-edit, .form-newsletter-manage {
    display: block;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #fff;
    border-top: 4px solid @theme-color;
    padding: 35px 25px 0;
    box-shadow: 0 2px 3px rgba(0,0,0,0.08);
}

.form.password.reset, .form.send.confirmation, .form.password.forget, .form.create.account, .form.form-edit-account, .form-address-edit, .form-newsletter-manage{
    padding-bottom: 35px;
}

.fieldset > .legend {
    padding: 0;
    border: 0;
    color: @theme-color;
    text-transform: uppercase;
    margin: 0 0 20px;
    font-size: 16px;
    font-weight: 400;
}

.box {
    .box-title {
        padding: 10px 15px;
        border: 1px solid #ddd;
        background-color: #f5f5f5;
        position: relative;
        border-radius: 7px 7px 0 0;
    }
    .box-content {
        padding: 20px 15px;
        font-size: 13px;
        border: 1px solid #ddd;
        border-top: 0;
        background-color: #fbfbfb;
        min-height: 135px;
    }
    .box-actions {
        margin: 0;
        border: 1px solid #ddd;
        border-top: 0;
        background-color: #f5f5f5;
        border-radius: 0 0 7px 7px;
        padding: 10px 15px;
    }
}

.block-order-details-view {
    margin: 0 -10px;
    
    .block-title {
        padding: 0 10px;
    }
    .box {
        padding: 0 10px;
        
        .box-content {
            min-height: 155px;
            border-radius: 0 0 5px 5px;
        }
    }
}

.block-dashboard-addresses {
    address {
        margin-bottom: 0;
    }
}

.customer-account-index {
    .block {
        .block-title {
            color: #313131;
            
            strong {
                font-weight: 600;
            }
        }
    }
    .box {
        .box-title {
            color: #313131;
            font-weight: 600;
            text-transform: uppercase;
        }
    }
}

.block-addresses-list {
    .items.addresses {
        > .item {
            margin-bottom: @indent__base;
            &:last-child {
                margin-bottom: 0;
            }
        }
        .item.actions {
            margin-top: @indent__xs;
            .action {
                &:extend(.abs-account-actions all);
            }
        }
    }
    address {
        &:extend(.abs-account-block-line-height all);
    }
}

.form-address-edit {
    #region_id {
        display: none;
    }
    .actions-toolbar .action.primary {
        &:extend(.abs-button-l all);
    }
}

.form-edit-account {
    .fieldset.password {
        display: none;
    }
}

.form-create-account {
    .fieldset-fullname {
        .fields {
            .field {
                float: none;
            }
        }
    }
}

.box-billing-address,
.box-shipping-address,
.box-information,
.box-newsletter {
    .box-content {
        &:extend(.abs-account-block-line-height all);
    }
}

//  My account
.account {
    .page-title-wrapper {
        .page-title {
            display: inline-block;
        }
    }
    .column.main {
        margin-bottom: @indent__l;
        h2 {
            margin-top: 0;
        }
        .block:not(.widget) {
            &:extend(.abs-account-blocks all);
        }
    }
    .sidebar-additional {
        margin-top: @indent__xl;
    }

    .table-wrapper {
        .lib-css(margin-bottom, @indent__base);
        &:last-child {
            margin-bottom: 0;
        }
    }
    .legend {
        &:extend(.abs-account-title all);
    }
}

.account,
[class^="sales-guest-"],
.sales-guest-view {
    .column.main {
        .order-details-items {
            .table-wrapper {
                .data.table {
                    &:extend(.abs-table-striped all);
                }
            }
        }
    }
    .data.table {
        .col.actions {
            .action {
                &:extend(.abs-account-actions all);
                &.delete {
                    .lib-css(color, @account-table-action-delete);
                }
            }
        }
    }
}

//  Checkout address (create shipping address)
.field.street {
    .field.additional {
        .label {
            &:extend(.abs-visually-hidden all);
        }
    }
}

//
//  Blocks & Widgets
//  ---------------------------------------------

.block {
    &:extend(.abs-margin-for-blocks-and-widgets all);
    .column.main & {
        &:last-child {
            margin-bottom: 0;
        }
    }
    .title {
        strong {
            font-size: 18px;
            color: #313131;
            padding: 10px 0;
            margin: 0;
            line-height: 1;
            .column.main & {
            }
        }
        margin-bottom: @indent__s;
    }
    p:last-child {
        margin: 0;
    }
    .box-actions {
        .action {
            &:extend(.abs-account-actions all);
        }
    }
}

.control.captcha-image {
    .lib-css(margin-top, @indent__s);
    .captcha-img {
        vertical-align: middle;
    }
}

.account {
    .data.table-return-items {
        .qty {
            .input-text {
                &:extend(.abs-input-qty all);
            }
        }
    }
}

}

//
//  Desktop
//  ---------------------------------------------

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .login-container {
        &:extend(.abs-add-clearfix-desktop all);
        .block {
            &:extend(.abs-blocks-2columns all);
            &.login {
                .actions-toolbar {
                    > .primary {
                        margin-bottom: 0;
                        margin-left: @indent__l;
                    }
                    > .secondary {
                        float: right;
                    }
                }
            }
        }
        .fieldset {
            > .field {
                > .control {
                    width: 55%;
                }
            }
        }
    }
    
    .actions-toolbar .secondary a.action {
        margin-top: 10px;
    }
    
    .form-create-account {
        .fieldset-fullname {
            .fields {
                .field {
                    float: right;
                    margin: 0 0 @indent__s @indent__s;
                }
            }
            .field-name-prefix,
            .field-name-suffix {
                width: 50px;
            }
        }
    }

    .form.create.account {
        padding: 35px 0;
        
        > .fieldset {
            width: 50%;
            padding: 0 25px;
            float: right;
        }
        .actions-toolbar {
            clear: both;
            padding: 0 25px;
        }
    }
    
    .form.forget .field {
        max-width: 600px;
    }
    //  My account
    .account.page-layout-2columns-left {
        .sidebar-main,
        .sidebar-additional {
            width: 22.3%;
        }
        .column.main {
            width: 77.7%;
        }
    }

    .account {
        .page-title-wrapper {
            &:extend(.abs-add-clearfix-desktop all);
        }
        .column.main {
            .block:not(.widget) {
                .block-content {
                    &:extend(.abs-add-clearfix-desktop all);
                    .box {
                        &:extend(.abs-blocks-2columns all);
                    }
                }
            }
        }
        .data.table {
            margin-bottom: 0;
            .col {
                &.actions {
                    white-space: nowrap;
                }
            }
        }
        .toolbar {
            &:extend(.abs-pager-toolbar all);
        }
    }

    .block-addresses-list {
        .items.addresses {
            &:extend(.abs-add-clearfix-desktop all);
            > .item {
                &:extend(.abs-blocks-2columns all);
                margin-bottom: @indent__base;
                &:nth-last-child(1),
                &:nth-last-child(2) {
                    margin-bottom: 0;
                }
            }
        }
        address {
            &:extend(.abs-account-block-font-size all);
        }
    }

    .page-main .block {
        &:extend(.abs-margin-for-blocks-and-widgets-desktop all);
    }

    .form-edit-account,
    .form-address-edit {
        .fieldset {
            &:extend(.abs-blocks-2columns all);
        }
    }

    .box-billing-address,
    .box-shipping-address,
    .box-information {
        .box-content {
            &:extend(.abs-account-block-font-size all);
        }
    }

    .control.captcha-image {
        .captcha-img {
            margin: 0 0 @indent__s @indent__s;
        }
    }
}

//
//  Mobile @screen__s
//  ---------------------------------------------

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .account {
        .column.main,
        .sidebar-additional {
            margin: 0;
        }
        .data.table {
            &:extend(.abs-table-striped-mobile all);
        }
    }
}

//
//  Mobile @screen__m
//  ---------------------------------------------

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
    .login-container {
        padding-bottom: 35px;
        
        .fieldset {
            &:after {
                text-align: center;
            }
        }
    }

    .account {
        .page.messages {
            margin-bottom: @indent__xl;
        }
        .column.main {
            .block:not(.widget) {
                .block-title {
                    &:extend(.abs-add-clearfix-mobile-m all);
                    > .action {
                        float: left;
                        .lib-css(margin-top, @indent__xs);
                    }
                }
                .block-content {
                    .box {
                        .lib-css(margin-bottom, @indent__base);
                        &:last-child {
                            margin-bottom: 0;
                        }
                    }
                }
            }
        }
    }
    .control.captcha-image {
        .captcha-img {
            display: block;
            .lib-css(margin-bottom, @indent__s);
        }
    }
    .customer-account-index {
        .page-title-wrapper {
            position: relative;
        }
    }
}
